import { RouteBase } from '@/interfaces/route';
import { Login, UserInfo } from '@/interfaces/auth';
import request from './request';

export const login = (data: Login) =>
  request<string>({
    method: 'POST',
    url: '/auth/login',
    data
  });

export const getUser = () =>
  request<UserInfo>({
    method: 'GET',
    url: '/auth/user'
  });

export const getRoutes = () =>
  request<RouteBase[]>({
    method: 'GET',
    url: '/route'
  });
